package com.yxq.mdt.app.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @描述 分享微信等平台实体类
 * @作者 yd
 * @创建日期 2019/9/12 0012 15:03
 */
public class ShareBean implements Parcelable {
    private String title;// 分享文本
    private String text;// 分享标题
    private String url;// 分享h5链接
    private String imageUrl;// 分享封面图
    private String shareType;// 0-图文分享；1-图片分享
    private int shareTypeAPP;// 2：社区（动态）分享 3：商品分享 4：拍卖活动分享
    private String handleId;

    public ShareBean() {

    }

    public ShareBean(String title, String text, String url, String imageUrl) {
        this.title = title;
        this.text = text;
        this.url = url;
        this.imageUrl = imageUrl;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        if (text != null && text.equals("[]")) {
            return "社交电商新玩法，好玩让你意想不到。";
        }
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getShareType() {
        return shareType;
    }

    public void setShareType(String shareType) {
        this.shareType = shareType;
    }

    public void setShareTypeAPP(int shareTypeAPP) {
        this.shareTypeAPP = shareTypeAPP;
    }

    public int getShareTypeAPP() {
        return shareTypeAPP;
    }

    public void setHandleId(String handleId) {
        this.handleId = handleId;
    }

    public String getHandleId() {
        return handleId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeString(this.text);
        dest.writeString(this.url);
        dest.writeString(this.imageUrl);
        dest.writeString(this.shareType);
        dest.writeInt(this.shareTypeAPP);
        dest.writeString(this.handleId);
    }

    protected ShareBean(Parcel in) {
        this.title = in.readString();
        this.text = in.readString();
        this.url = in.readString();
        this.imageUrl = in.readString();
        this.shareType = in.readString();
        this.shareTypeAPP = in.readInt();
        this.handleId = in.readString();
    }

    public static final Creator<ShareBean> CREATOR = new Creator<ShareBean>() {
        @Override
        public ShareBean createFromParcel(Parcel source) {
            return new ShareBean(source);
        }

        @Override
        public ShareBean[] newArray(int size) {
            return new ShareBean[size];
        }
    };
}
